import time

from selenium import webdriver
from selenium.webdriver import ActionChains

# 设置url
url = "http://127.0.0.1:8080/login"
# 实例化driver
driver = webdriver.Chrome('./chromedriver.exe')
driver.get(url)

time.sleep(1)
# 输入账号密码
username = driver.find_element_by_xpath('//div[@class="container"]/div[1]/input')
username.send_keys('123')
password = driver.find_element_by_xpath('//div[@class="container"]/div[2]/input')
password.send_keys('123')

# 获取 需要滑动的元素
button = driver.find_element_by_xpath('//*[@id="app"]/div/section/div/center/div/div/div[3]')
# 滑动并松开
ActionChains(driver).drag_and_drop_by_offset(button,270,0).perform()

# 登录
sub = driver.find_element_by_xpath('//*[@id="app"]/div/section/div/button')
sub.click()














